﻿using LangRenGameLib.Enum;
using LangRenGameLib.RoundInterface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LangRenGameLib.Card.Skill
{
    /// <summary>
    /// 角色技能总类，判定规则大概是遍历角色的所有技能，如果这个技能可以触发的话就会返回true
    /// </summary>
    class CardSkill : IRound
    {
        public bool IsSkill()
        {
            return true;
        }

        /// <summary>
        /// 技能名称
        /// </summary>
        public string SkillName;

        /// <summary>
        /// 持有该技能的角色
        /// </summary>
        public Card Owner;

        /// <summary>
        /// 该技能需要选择目标
        /// </summary>
        public bool HaveTarget
        {
            get;
            protected set;
        }

        /// <summary>
        /// 该技能需要目标的数量
        /// </summary>
        public int HaveTargetNum
        {
            get;
            protected set;
        }

        public virtual bool EndAllPlayerTalk()
        {
            return false;
        }

        public virtual bool EndPlayerTalk(int PlayerID)
        {
            return false;
        }

        public virtual bool OnNightSkill(int round)
        {
            return false;
        }

        public virtual bool OnPlayerTalk(int PlayerID)
        {
            return false;
        }

        public virtual bool OnStartPlayerTalk()
        {
            return false;
        }

        public virtual bool OnToDay()
        {
            return false;
        }

        public virtual bool OnToNight()
        {
            return false;
        }

        /// <summary>
        /// 当死亡后触发
        /// </summary>
        public virtual void OnDie(DieType type)
        {

        }

        /// <summary>
        /// 当被选中为技能目标时
        /// </summary>
        /// <param name="atter">来源于谁</param>
        /// <returns>技能是否生效</returns>
        public virtual bool OnTakeSkill(Player.PlayerInfo atter, SkillType type)
        {
            return true;
        }

        /// <summary>
        /// 技能触发，在特定时间报告要触发技能后会由游戏进程类进行通知执行此类
        /// </summary>
        public virtual void TargetSkill()
        {

        }

        /// <summary>
        /// 技能触发，并且如果是有技能目标的技能会调用这个类
        /// </summary>
        public virtual void TargetSkill(Card[] Target)
        {

        }
    }
}
